/*
 * DesktopApplication1View.java
 */

package gui.main;

import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;

import actions.EventHandler;

import utils.Utils;

import gui.GUIUtils;
import gui.controllers.JobPanelController;
import gui.filetree.FileTreeExpansionListener;
import gui.filetree.TreeUtils;

import java.awt.Color;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.table.DefaultTableModel;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeSelectionModel;

/**
 * The application's main frame.
 */
public class MainPanelGUIView extends FrameView {

    public MainPanelGUIView(SingleFrameApplication app) {
        super(app);

        initComponents();

        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("Status messages");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(true);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName)) {
                    if (!busyIconTimer.isRunning()) {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(true);
                } else if ("done".equals(propertyName)) {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                    progressBar.setVisible(false);
                    progressBar.setValue(0);
                } else if ("message".equals(propertyName)) {
                    String text = (String)(evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName)) {
                    int value = (Integer)(evt.getNewValue());
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(false);
                    progressBar.setValue(value);
                }
            }
        });
        
        //---------------------------------------------------------------///
        getFrame().setResizable(false);
        SpinnerModel model =
            new SpinnerNumberModel(1, //initial value
                                   1, //min
                                   9999, //max
                                   1);
        SpinnerModel model1 =
            new SpinnerNumberModel(1, //initial value
                                   1, //min
                                   9999, //max
                                   1);
        SpinnerModel model2 =
            new SpinnerNumberModel(0, //initial value
                                   0, //min
                                   48, //max
                                   1); 
        SpinnerModel model3 =
            new SpinnerNumberModel(1, //initial value
                                   1, //min
                                   9999, //max
                                   1); 
        nodesSpin.setModel(model);
        ppnSpin.setModel(model1);
        hoursSpin.setModel(model2);
        replaySpin.setModel(model3);
        fileTreeComponent.getSelectionModel().setSelectionMode(
				TreeSelectionModel.SINGLE_TREE_SELECTION);
        fileTreeComponent.addTreeExpansionListener(new FileTreeExpansionListener());
		fileTreeComponent.setModel(new DefaultTreeModel(TreeUtils.rootNode));
        //fileTree.addTreeSelectionListener(this);
        fileTreeComponent.putClientProperty("JTree.lineStyle", "Horizontal");
        GUIUtils.MainPanel = this;
        TreeUtils.fileTree = this.fileTreeComponent;
       //GUIUtils.centrePositionOnScreen(this.getFrame());
        //---------------------------------------------------------------///
    }
    
    public void setMessageLbl(String txt) {
    	statusMessageLabel.setText(txt);
    }
    public void setStatusLbl(final String txt) {
    	setStatusLbl(txt, Color.BLACK);
    }
    public void setStatusLbl(final String txt, final Color color) {
    	statusL.setText(txt);
    	statusL.setForeground(color);
    }
    public void setDiskSpaceLbl(String txt) {
    	diskSpaceL.setText("Disk space: "+txt+"/100Mb");
    }

  //---------------------------------------------------------------///
    
    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = MainPanelGUI.getApplication().getMainFrame();
            aboutBox = new MainPanelAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        MainPanelGUI.getApplication().show(aboutBox);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        topPanel = new javax.swing.JPanel();
        userL = new javax.swing.JLabel();
        lastLoginL = new javax.swing.JLabel();
        diskSpaceL = new javax.swing.JLabel();
        runJobsL = new javax.swing.JLabel();
        sysAvailL = new javax.swing.JLabel();
        tabbedPane = new javax.swing.JTabbedPane();
        jobTabPanel = new javax.swing.JPanel();
        treeScrollPane = new javax.swing.JScrollPane();
        fileTreeComponent = new javax.swing.JTree();
        jPanel1 = new javax.swing.JPanel();
        jobProbsPanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jobNameTxt = new javax.swing.JTextField();
        resultsDirTxt = new javax.swing.JTextField();
        jobDirTxt = new javax.swing.JTextField();
        jobDirB = new javax.swing.JButton();
        resultsDirB = new javax.swing.JButton();
        OptPropsPanel = new javax.swing.JPanel();
        optRadio = new javax.swing.JRadioButton();
        optCombo = new javax.swing.JComboBox();
        assignRadio = new javax.swing.JRadioButton();
        clusterCombo = new javax.swing.JComboBox();
        jLabel11 = new javax.swing.JLabel();
        hoursSpin = new javax.swing.JSpinner();
        jLabel12 = new javax.swing.JLabel();
        PbsPropsPanel = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        nodesSpin = new javax.swing.JSpinner();
        ppnSpin = new javax.swing.JSpinner();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        execTxt = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        argsTxt = new javax.swing.JTextField();
        wallTimeTxt = new javax.swing.JTextField();
        PrefPanel = new javax.swing.JPanel();
        loadB = new javax.swing.JButton();
        saveB = new javax.swing.JButton();
        resultsBackChk = new javax.swing.JCheckBox();
        PBSchk = new javax.swing.JCheckBox();
        PbsTxt = new javax.swing.JTextField();
        PbsB = new javax.swing.JButton();
        onceRadio = new javax.swing.JRadioButton();
        replayRadio = new javax.swing.JRadioButton();
        replaySpin = new javax.swing.JSpinner();
        jLabel10 = new javax.swing.JLabel();
        submitB = new javax.swing.JButton();
        unzipChk = new javax.swing.JCheckBox();
        currentJobsTabPanel = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jobsList = new javax.swing.JList();
        jScrollPane2 = new javax.swing.JScrollPane();
        jobsTable = new javax.swing.JTable();
        hostsTabPanel = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        hostsList = new javax.swing.JList();
        jScrollPane3 = new javax.swing.JScrollPane();
        hostsTable = new javax.swing.JTable();
        buttonPanel = new javax.swing.JPanel();
        UsernameL = new javax.swing.JLabel();
        userTxt = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        passTxt = new javax.swing.JTextField();
        statusL = new javax.swing.JLabel();
        loginB = new javax.swing.JButton();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
        statusPanel = new javax.swing.JPanel();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();

        mainPanel.setMaximumSize(new java.awt.Dimension(1025, 519));
        mainPanel.setName("mainPanel"); // NOI18N

        topPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        topPanel.setName("topPanel"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(gui.main.MainPanelGUI.class).getContext().getResourceMap(MainPanelGUIView.class);
        userL.setText(resourceMap.getString("userL.text")); // NOI18N
        userL.setName("userL"); // NOI18N

        lastLoginL.setText(resourceMap.getString("lastLoginL.text")); // NOI18N
        lastLoginL.setName("lastLoginL"); // NOI18N

        diskSpaceL.setText(resourceMap.getString("diskSpaceL.text")); // NOI18N
        diskSpaceL.setName("diskSpaceL"); // NOI18N

        runJobsL.setText(resourceMap.getString("runJobsL.text")); // NOI18N
        runJobsL.setName("runJobsL"); // NOI18N

        sysAvailL.setText(resourceMap.getString("sysAvailL.text")); // NOI18N
        sysAvailL.setName("sysAvailL"); // NOI18N

        javax.swing.GroupLayout topPanelLayout = new javax.swing.GroupLayout(topPanel);
        topPanel.setLayout(topPanelLayout);
        topPanelLayout.setHorizontalGroup(
            topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(topPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(userL)
                .addGap(111, 111, 111)
                .addComponent(lastLoginL)
                .addGap(125, 125, 125)
                .addComponent(diskSpaceL)
                .addGap(125, 125, 125)
                .addComponent(runJobsL)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 115, Short.MAX_VALUE)
                .addComponent(sysAvailL)
                .addGap(93, 93, 93))
        );
        topPanelLayout.setVerticalGroup(
            topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(topPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(userL)
                    .addComponent(lastLoginL)
                    .addComponent(diskSpaceL)
                    .addComponent(runJobsL)
                    .addComponent(sysAvailL))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        tabbedPane.setMaximumSize(new java.awt.Dimension(1020, 391));
        tabbedPane.setMinimumSize(new java.awt.Dimension(0, 0));
        tabbedPane.setName("tabbedPane"); // NOI18N

        jobTabPanel.setName("jobTabPanel"); // NOI18N

        treeScrollPane.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        treeScrollPane.setName("treeScrollPane"); // NOI18N

        javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("Username");
        javax.swing.tree.DefaultMutableTreeNode treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("<empty>");
        treeNode1.add(treeNode2);
        fileTreeComponent.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
        fileTreeComponent.setName("fileTree"); // NOI18N
        treeScrollPane.setViewportView(fileTreeComponent);

        jPanel1.setName("jPanel1"); // NOI18N

        jobProbsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jobProbsPanel.border.title"))); // NOI18N
        jobProbsPanel.setName("jobProbsPanel"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jobNameTxt.setText(resourceMap.getString("jobNameTxt.text")); // NOI18N
        jobNameTxt.setName("jobNameTxt"); // NOI18N

        resultsDirTxt.setText(resourceMap.getString("resultsDirTxt.text")); // NOI18N
        resultsDirTxt.setName("resultsDirTxt"); // NOI18N

        jobDirTxt.setText(resourceMap.getString("jobDirTxt.text")); // NOI18N
        jobDirTxt.setName("jobDirTxt"); // NOI18N

        jobDirB.setText(resourceMap.getString("jobDirB.text")); // NOI18N
        jobDirB.setName("jobDirB"); // NOI18N
        jobDirB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jobDirBMouseClicked(evt);
            }
        });

        resultsDirB.setText(resourceMap.getString("resultsDirB.text")); // NOI18N
        resultsDirB.setName("resultsDirB"); // NOI18N
        resultsDirB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                resultsDirBMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jobProbsPanelLayout = new javax.swing.GroupLayout(jobProbsPanel);
        jobProbsPanel.setLayout(jobProbsPanelLayout);
        jobProbsPanelLayout.setHorizontalGroup(
            jobProbsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jobProbsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jobProbsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jobProbsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(resultsDirTxt)
                    .addComponent(jobDirTxt)
                    .addComponent(jobNameTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jobProbsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jobDirB, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(resultsDirB, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jobProbsPanelLayout.setVerticalGroup(
            jobProbsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jobProbsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jobProbsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jobNameTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jobProbsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jobDirTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jobDirB))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jobProbsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(resultsDirTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(resultsDirB))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        OptPropsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("OptPropsPanel.border.title"))); // NOI18N
        OptPropsPanel.setMaximumSize(new java.awt.Dimension(389, 160));
        OptPropsPanel.setName("OptPropsPanel"); // NOI18N
        OptPropsPanel.setPreferredSize(new java.awt.Dimension(389, 160));

        optRadio.setSelected(true);
        optRadio.setText(resourceMap.getString("optRadio.text")); // NOI18N
        optRadio.setName("optRadio"); // NOI18N
        optRadio.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                optRadioMouseClicked(evt);
            }
        });

        optCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Queue time", "Resource availability", "CO2 emissions" }));
        optCombo.setName("optCombo"); // NOI18N

        assignRadio.setText(resourceMap.getString("assignRadio.text")); // NOI18N
        assignRadio.setName("assignRadio"); // NOI18N
        assignRadio.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                assignRadioMouseClicked(evt);
            }
        });

        clusterCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "No online cluster" }));
        clusterCombo.setName("clusterCombo"); // NOI18N

        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        hoursSpin.setName("hoursSpin"); // NOI18N

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        javax.swing.GroupLayout OptPropsPanelLayout = new javax.swing.GroupLayout(OptPropsPanel);
        OptPropsPanel.setLayout(OptPropsPanelLayout);
        OptPropsPanelLayout.setHorizontalGroup(
            OptPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(OptPropsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(OptPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(OptPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jLabel11)
                        .addComponent(optRadio))
                    .addComponent(assignRadio))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(OptPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(OptPropsPanelLayout.createSequentialGroup()
                        .addComponent(hoursSpin, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(4, 4, 4)
                        .addComponent(jLabel12))
                    .addComponent(clusterCombo, 0, 222, Short.MAX_VALUE)
                    .addComponent(optCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(29, Short.MAX_VALUE))
        );
        OptPropsPanelLayout.setVerticalGroup(
            OptPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(OptPropsPanelLayout.createSequentialGroup()
                .addGroup(OptPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(optRadio)
                    .addComponent(optCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(OptPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(hoursSpin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12))
                .addGap(18, 18, 18)
                .addGroup(OptPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(assignRadio)
                    .addComponent(clusterCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        PbsPropsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("PbsPropsPanel.border.title"))); // NOI18N
        PbsPropsPanel.setName("PbsPropsPanel"); // NOI18N
        PbsPropsPanel.setPreferredSize(new java.awt.Dimension(389, 160));

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        nodesSpin.setName("nodesSpin"); // NOI18N

        ppnSpin.setName("ppnSpin"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        execTxt.setText(resourceMap.getString("execTxt.text")); // NOI18N
        execTxt.setName("execTxt"); // NOI18N

        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        argsTxt.setText(resourceMap.getString("argsTxt.text")); // NOI18N
        argsTxt.setName("argsTxt"); // NOI18N

        wallTimeTxt.setText(resourceMap.getString("walltimeTxt.text")); // NOI18N
        wallTimeTxt.setName("walltimeTxt"); // NOI18N

        javax.swing.GroupLayout PbsPropsPanelLayout = new javax.swing.GroupLayout(PbsPropsPanel);
        PbsPropsPanel.setLayout(PbsPropsPanelLayout);
        PbsPropsPanelLayout.setHorizontalGroup(
            PbsPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PbsPropsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PbsPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PbsPropsPanelLayout.createSequentialGroup()
                        .addGroup(PbsPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addComponent(jLabel8))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(PbsPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(PbsPropsPanelLayout.createSequentialGroup()
                                .addComponent(nodesSpin, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(22, 22, 22)
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(ppnSpin, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(PbsPropsPanelLayout.createSequentialGroup()
                                .addComponent(execTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(wallTimeTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE))))
                    .addGroup(PbsPropsPanelLayout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(argsTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 290, Short.MAX_VALUE)))
                .addGap(16, 16, 16))
        );
        PbsPropsPanelLayout.setVerticalGroup(
            PbsPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PbsPropsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PbsPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(nodesSpin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ppnSpin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PbsPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(execTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(wallTimeTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(PbsPropsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(argsTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        PrefPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("PrefPanel.border.title"))); // NOI18N
        PrefPanel.setMaximumSize(new java.awt.Dimension(389, 160));
        PrefPanel.setName("PrefPanel"); // NOI18N
        PrefPanel.setPreferredSize(new java.awt.Dimension(389, 160));
        PrefPanel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                PrefPanelMouseClicked(evt);
            }
        });

        loadB.setText(resourceMap.getString("loadB.text")); // NOI18N
        loadB.setName("loadB"); // NOI18N
        loadB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                loadBMouseClicked(evt);
            }
        });

        saveB.setText(resourceMap.getString("saveB.text")); // NOI18N
        saveB.setName("saveB"); // NOI18N
        saveB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                saveBMouseClicked(evt);
            }
        });

        resultsBackChk.setSelected(true);
        resultsBackChk.setText(resourceMap.getString("resultsBackChk.text")); // NOI18N
        resultsBackChk.setName("resultsBackChk"); // NOI18N
        resultsBackChk.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                resultsBackChkMouseClicked(evt);
            }
        });

        PBSchk.setText(resourceMap.getString("PBSchk.text")); // NOI18N
        PBSchk.setName("PBSchk"); // NOI18N

        PbsTxt.setText(resourceMap.getString("PbsTxt.text")); // NOI18N
        PbsTxt.setName("PbsTxt"); // NOI18N

        PbsB.setText(resourceMap.getString("PbsB.text")); // NOI18N
        PbsB.setName("PbsB"); // NOI18N
        PbsB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                PbsBMouseClicked(evt);
            }
        });

        onceRadio.setSelected(true);
        onceRadio.setText(resourceMap.getString("onceRadio.text")); // NOI18N
        onceRadio.setName("onceRadio"); // NOI18N
        onceRadio.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                onceRadioMouseClicked(evt);
            }
        });

        replayRadio.setText(resourceMap.getString("replayRadio.text")); // NOI18N
        replayRadio.setName("replayRadio"); // NOI18N
        replayRadio.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                replayRadioMouseClicked(evt);
            }
        });

        replaySpin.setName("replaySpin"); // NOI18N

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        submitB.setText(resourceMap.getString("submitB.text")); // NOI18N
        submitB.setName("submitB"); // NOI18N
        submitB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                submitBMouseClicked(evt);
            }
        });

        unzipChk.setSelected(true);
        unzipChk.setText(resourceMap.getString("unzipChk.text")); // NOI18N
        unzipChk.setName("unzipChk"); // NOI18N

        javax.swing.GroupLayout PrefPanelLayout = new javax.swing.GroupLayout(PrefPanel);
        PrefPanel.setLayout(PrefPanelLayout);
        PrefPanelLayout.setHorizontalGroup(
            PrefPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PrefPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PrefPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(PrefPanelLayout.createSequentialGroup()
                        .addComponent(resultsBackChk)
                        .addGap(18, 18, 18)
                        .addComponent(unzipChk, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(PrefPanelLayout.createSequentialGroup()
                        .addComponent(PBSchk)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(PbsTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(PbsB, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(PrefPanelLayout.createSequentialGroup()
                        .addGroup(PrefPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(onceRadio)
                            .addGroup(PrefPanelLayout.createSequentialGroup()
                                .addComponent(loadB)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(saveB)))
                        .addGap(18, 18, 18)
                        .addGroup(PrefPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(replayRadio)
                            .addComponent(submitB))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(replaySpin, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel10)))
                .addContainerGap())
        );
        PrefPanelLayout.setVerticalGroup(
            PrefPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PrefPanelLayout.createSequentialGroup()
                .addGroup(PrefPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(resultsBackChk)
                    .addComponent(unzipChk))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PrefPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(PBSchk)
                    .addComponent(PbsTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(PbsB))
                .addGroup(PrefPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(onceRadio)
                    .addComponent(replayRadio)
                    .addComponent(replaySpin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PrefPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(loadB)
                    .addComponent(saveB)
                    .addComponent(submitB))
                .addGap(30, 30, 30))
        );

        PbsB.getAccessibleContext().setAccessibleName(resourceMap.getString("PbsB.AccessibleContext.accessibleName")); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(OptPropsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jobProbsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(PrefPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 417, Short.MAX_VALUE)
                    .addComponent(PbsPropsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 417, Short.MAX_VALUE))
                .addGap(14, 14, 14))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(PbsPropsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jobProbsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(PrefPanel, 0, 151, Short.MAX_VALUE)
                    .addComponent(OptPropsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)))
        );

        javax.swing.GroupLayout jobTabPanelLayout = new javax.swing.GroupLayout(jobTabPanel);
        jobTabPanel.setLayout(jobTabPanelLayout);
        jobTabPanelLayout.setHorizontalGroup(
            jobTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jobTabPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(treeScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jobTabPanelLayout.setVerticalGroup(
            jobTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jobTabPanelLayout.createSequentialGroup()
                .addGroup(jobTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jobTabPanelLayout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(treeScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE)))
                .addContainerGap())
        );

        tabbedPane.addTab(resourceMap.getString("jobTabPanel.TabConstraints.tabTitle"), jobTabPanel); // NOI18N

        currentJobsTabPanel.setName("currrentJobsTabPanel"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jobsList.setModel(new javax.swing.DefaultListModel());
        jobsList.setName("jobList"); // NOI18N
        jScrollPane1.setViewportView(jobsList);

        jScrollPane2.setName("jScrollPane2"); // NOI18N
        
        jobsTable = new JTable(JobPanelController.getRows(), JobPanelController.getCols());
		
        jobsTable.addMouseListener( new MouseAdapter()
		{
			public void mouseClicked( MouseEvent e )
			{
				if(e.isPopupTrigger())
				{
					Utils.out("popup trigger");
				}
				// Left mouse click
				if ( SwingUtilities.isLeftMouseButton( e ) )
				{
					// Do something
				}
				// Right mouse click
				else if ( SwingUtilities.isRightMouseButton( e ) )
				{
					// get the coordinates of the mouse click
					Point p = e.getPoint();
		 
					// get the row index that contains that coordinate
					int rowNumber = jobsTable.rowAtPoint( p );
		 
					// Get the ListSelectionModel of the JTable
					ListSelectionModel model = jobsTable.getSelectionModel();
		 
					// set the selected interval of rows. Using the "rowNumber"
					// variable for the beginning and end selects only that one row.
					model.setSelectionInterval( rowNumber, rowNumber );
				}
			}
		});
        jobsTable.setModel(new DefaultTableModel());
        ((DefaultTableModel)jobsTable.getModel()).setDataVector(JobPanelController.getRows(), JobPanelController.getCols());
        
        
        jobsTable.setName("jobTable"); // NOI18N
        jScrollPane2.setViewportView(jobsTable);

        javax.swing.GroupLayout currentJobsTabPanelLayout = new javax.swing.GroupLayout(currentJobsTabPanel);
        currentJobsTabPanel.setLayout(currentJobsTabPanelLayout);
        currentJobsTabPanelLayout.setHorizontalGroup(
            currentJobsTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, currentJobsTabPanelLayout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 840, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        currentJobsTabPanelLayout.setVerticalGroup(
            currentJobsTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
        );

        tabbedPane.addTab(resourceMap.getString("currrentJobsTabPanel.TabConstraints.tabTitle"), currentJobsTabPanel); // NOI18N

        hostsTabPanel.setName("hostsTabPanel"); // NOI18N

        jScrollPane4.setName("jScrollPane4"); // NOI18N

        hostsList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        hostsList.setName("hostsList"); // NOI18N
        jScrollPane4.setViewportView(hostsList);

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        hostsTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        hostsTable.setMaximumSize(null);
        hostsTable.setName("hostsTable"); // NOI18N
        jScrollPane3.setViewportView(hostsTable);

        javax.swing.GroupLayout hostsTabPanelLayout = new javax.swing.GroupLayout(hostsTabPanel);
        hostsTabPanel.setLayout(hostsTabPanelLayout);
        hostsTabPanelLayout.setHorizontalGroup(
            hostsTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(hostsTabPanelLayout.createSequentialGroup()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 821, Short.MAX_VALUE))
        );
        hostsTabPanelLayout.setVerticalGroup(
            hostsTabPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
        );

        tabbedPane.addTab(resourceMap.getString("hostsTabPanel.TabConstraints.tabTitle"), hostsTabPanel); // NOI18N

        buttonPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        buttonPanel.setName("buttonPanel"); // NOI18N

        UsernameL.setText(resourceMap.getString("UsernameL.text")); // NOI18N
        UsernameL.setName("UsernameL"); // NOI18N

        userTxt.setText(resourceMap.getString("userTxt.text")); // NOI18N
        userTxt.setName("userTxt"); // NOI18N
        userTxt.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                userTxtKeyReleased(evt);
            }
        });

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        passTxt.setText(resourceMap.getString("passTxt.text")); // NOI18N
        passTxt.setName("passTxt"); // NOI18N
        passTxt.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                passTxtKeyReleased(evt);
            }
        });

        statusL.setText(resourceMap.getString("statusL.text")); // NOI18N
        statusL.setName("statusL"); // NOI18N

        loginB.setText(resourceMap.getString("loginB.text")); // NOI18N
        loginB.setName("loginB"); // NOI18N
        loginB.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                loginBMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout buttonPanelLayout = new javax.swing.GroupLayout(buttonPanel);
        buttonPanel.setLayout(buttonPanelLayout);
        buttonPanelLayout.setHorizontalGroup(
            buttonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(buttonPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(UsernameL)
                .addGap(2, 2, 2)
                .addComponent(userTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4)
                .addGap(3, 3, 3)
                .addComponent(passTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(loginB)
                .addGap(18, 18, 18)
                .addComponent(statusL, javax.swing.GroupLayout.DEFAULT_SIZE, 519, Short.MAX_VALUE)
                .addContainerGap())
        );
        buttonPanelLayout.setVerticalGroup(
            buttonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(buttonPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(UsernameL)
                .addComponent(statusL)
                .addComponent(userTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel4)
                .addComponent(passTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(loginB))
        );

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(tabbedPane, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(buttonPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(topPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGap(36, 36, 36))
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(buttonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(topPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 380, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        menuBar.setName("menuBar"); // NOI18N

        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(gui.main.MainPanelGUI.class).getContext().getActionMap(MainPanelGUIView.class, this);
        exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
        exitMenuItem.setName("exitMenuItem"); // NOI18N
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        statusPanel.setName("statusPanel"); // NOI18N
        statusPanel.setPreferredSize(new java.awt.Dimension(1051, 35));

        statusMessageLabel.setName("statusMessageLabel"); // NOI18N

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

        progressBar.setName("progressBar"); // NOI18N

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusPanelLayout.createSequentialGroup()
                .addContainerGap(188, Short.MAX_VALUE)
                .addComponent(statusMessageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 589, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(statusAnimationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(statusMessageLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE)
                    .addComponent(statusAnimationLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE)
                    .addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE))
                .addContainerGap())
        );

        setComponent(mainPanel);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>

    private void passTxtKeyReleased(java.awt.event.KeyEvent evt) {                                    
        EventHandler.passTxtKeyReleased(evt);
    }                                   

    private void userTxtKeyReleased(java.awt.event.KeyEvent evt) {                                    
    	EventHandler.userTxtKeyReleased(evt);
    }                                   

    private void resultsDirBMouseClicked(java.awt.event.MouseEvent evt) {                                         
    	EventHandler.resultsDirBMouseClicked(evt);
    }                                        

    private void loginBMouseClicked(java.awt.event.MouseEvent evt) {                                    
        EventHandler.loginBMouseClicked(evt);
    }                                   

    private void jobDirBMouseClicked(java.awt.event.MouseEvent evt) {                                     
    	EventHandler.jobDirBMouseClicked(evt);
    }                                    

    private void PbsBMouseClicked(java.awt.event.MouseEvent evt) {                                  
    	EventHandler.PbsBMouseClicked(evt);
    }                                 

    private void onceRadioMouseClicked(java.awt.event.MouseEvent evt) {                                       
    	EventHandler.onceRadioMouseClicked(evt);
    }                                      

    private void replayRadioMouseClicked(java.awt.event.MouseEvent evt) {                                         
    	EventHandler.replayRadioMouseClicked(evt);
    }                                        

    private void PrefPanelMouseClicked(java.awt.event.MouseEvent evt) {                                       
    	EventHandler.PrefPanelMouseClicked(evt);
    }                                      

    private void optRadioMouseClicked(java.awt.event.MouseEvent evt) {                                      
    	EventHandler.optRadioMouseClicked(evt);
    }                                     

    private void resultsBackChkMouseClicked(java.awt.event.MouseEvent evt) {                                            
    	EventHandler.resultsBackChkMouseClicked(evt);
    }                                           

    private void assignRadioMouseClicked(java.awt.event.MouseEvent evt) {                                         
    	EventHandler.assignRadioMouseClicked(evt);
    }                                        

    private void submitBMouseClicked(java.awt.event.MouseEvent evt) {
    	EventHandler.submitBMouseClicked(evt);
    }

    private void saveBMouseClicked(java.awt.event.MouseEvent evt) {
    	EventHandler.saveBMouseClicked(evt);
    }

    private void loadBMouseClicked(java.awt.event.MouseEvent evt) {
    	EventHandler.loadBMouseClicked(evt);
    }

    // Variables declaration - do not modify
    public javax.swing.JPanel OptPropsPanel;
    public javax.swing.JCheckBox PBSchk;
    public javax.swing.JButton PbsB;
    public javax.swing.JPanel PbsPropsPanel;
    public javax.swing.JTextField PbsTxt;
    public javax.swing.JPanel PrefPanel;
    public javax.swing.JLabel UsernameL;
    public javax.swing.JTextField argsTxt;
    public javax.swing.JRadioButton assignRadio;
    public javax.swing.JPanel buttonPanel;
    public javax.swing.JComboBox clusterCombo;
    public javax.swing.JPanel currentJobsTabPanel;
    public javax.swing.JLabel diskSpaceL;
    public javax.swing.JTextField execTxt;
    public javax.swing.JTree fileTreeComponent;
    public javax.swing.JList hostsList;
    public javax.swing.JPanel hostsTabPanel;
    public javax.swing.JTable hostsTable;
    public javax.swing.JSpinner hoursSpin;
    public javax.swing.JLabel jLabel1;
    public javax.swing.JLabel jLabel10;
    public javax.swing.JLabel jLabel11;
    public javax.swing.JLabel jLabel12;
    public javax.swing.JLabel jLabel2;
    public javax.swing.JLabel jLabel3;
    public javax.swing.JLabel jLabel4;
    public javax.swing.JLabel jLabel5;
    public javax.swing.JLabel jLabel6;
    public javax.swing.JLabel jLabel7;
    public javax.swing.JLabel jLabel8;
    public javax.swing.JLabel jLabel9;
    public javax.swing.JPanel jPanel1;
    public javax.swing.JScrollPane jScrollPane1;
    public javax.swing.JScrollPane jScrollPane2;
    public javax.swing.JScrollPane jScrollPane3;
    public javax.swing.JScrollPane jScrollPane4;
    public javax.swing.JButton jobDirB;
    public javax.swing.JTextField jobDirTxt;
    public javax.swing.JTextField jobNameTxt;
    public javax.swing.JPanel jobProbsPanel;
    public javax.swing.JPanel jobTabPanel;
    public javax.swing.JList jobsList;
    public static javax.swing.JTable jobsTable;
    public javax.swing.JLabel lastLoginL;
    public javax.swing.JButton loadB;
    public javax.swing.JButton loginB;
    public javax.swing.JPanel mainPanel;
    public javax.swing.JMenuBar menuBar;
    public javax.swing.JSpinner nodesSpin;
    public javax.swing.JRadioButton onceRadio;
    public javax.swing.JComboBox optCombo;
    public javax.swing.JRadioButton optRadio;
    public javax.swing.JTextField passTxt;
    public javax.swing.JSpinner ppnSpin;
    public javax.swing.JProgressBar progressBar;
    public javax.swing.JRadioButton replayRadio;
    public javax.swing.JSpinner replaySpin;
    public javax.swing.JCheckBox resultsBackChk;
    public javax.swing.JButton resultsDirB;
    public javax.swing.JTextField resultsDirTxt;
    public javax.swing.JLabel runJobsL;
    public javax.swing.JButton saveB;
    public javax.swing.JLabel statusAnimationLabel;
    public javax.swing.JLabel statusL;
    public javax.swing.JLabel statusMessageLabel;
    public javax.swing.JPanel statusPanel;
    public javax.swing.JButton submitB;
    public javax.swing.JLabel sysAvailL;
    public javax.swing.JTabbedPane tabbedPane;
    public javax.swing.JPanel topPanel;
    public javax.swing.JScrollPane treeScrollPane;
    public javax.swing.JCheckBox unzipChk;
    public javax.swing.JLabel userL;
    public javax.swing.JTextField userTxt;
    public javax.swing.JTextField wallTimeTxt;
    // End of variables declaration

    public final Timer messageTimer;
    public final Timer busyIconTimer;
    public final Icon idleIcon;
    public final Icon[] busyIcons = new Icon[15];
    public int busyIconIndex = 0;

    public JDialog aboutBox;
}

